#ifndef N2WIN32DRAWER_H_2009_10_16
#define N2WIN32DRAWER_H_2009_10_16

#ifdef WINDOWS

#include "N2Drawer.h"
#include <windows.h>

class N2Win32Drawer : public N2Drawer {
public:
    N2Win32Drawer(HDC hdc);
    virtual ~N2Win32Drawer();

    virtual N2Size getSize() const ;
    virtual uint32 getBitsPerPixel() const ;

    virtual uint32 getPixel(uint32 x, uint32 y) const ;
    virtual void   setPixel(uint32 x, uint32 y);
    virtual void   drawVertLine(uint32 x, uint32 y1, uint32 y2);
    virtual void   drawHorzLine(uint32 y, uint32 x1, uint32 x2);
    virtual void   fillRect(const N2Rect &rect);

    virtual N2Palette* getPalette() const ;

    virtual void             setWorldTransform(const N2WorldTransform &wt);
    virtual N2WorldTransform getWorldTransform() const ;

    virtual void     setColor(const N2Color &color);
    virtual N2Color  getColor() const ;

    virtual void     setBrush(N2Brush *brush);
    virtual N2Brush* getBrush() const ;

    virtual N2Color  getPoint(const N2Point &point) const ;

    virtual void drawPoint(const N2Point &point);
    virtual void drawLine(const N2Point &from, const N2Point &to);
    virtual void drawRect(const N2Rect &rect);
    virtual void drawShape(const N2Point *points, uint32 count);

protected:
    HDC m_dc;
    COLORREF m_color;
    N2Brush *m_brush;
    N2Size   m_size;

    POINT* allocPoints(uint32 count);
    void   freePoints(POINT* pnts);

    void  createPen(COLORREF color);
    void  createBrush(COLORREF color);
    void  setSize();
};

#endif //WINDOWS

#endif //N2WIN32DRAWER_H_2009_10_16
